package com.eshop.we.controller;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.eshop.we.business.CategoryBusiness;
import com.eshop.we.category.entity.Category;
import com.eshop.we.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/category")
public class CategoryController extends  BaseController {

    @Autowired
    private CategoryBusiness categoryBusiness;


    @GetMapping("/getcategorys")
    public Result getAllCategory(){
        return Result.success(categoryBusiness.selectList(new EntityWrapper<Category>().eq("status",0).orderBy("sort")));
    }
}
